﻿<!DOCTYPE html>
<html>
<head>
    <title>CGI</title>
</head>
<body>
    <h1>Our Page</h1>
    <script>
        //01
        //for floating point calculation, we should use toFixed
       
        var total = 5 + 3;
        console.log(total);

        var total = 5.1 + 3.3;
        console.log(total);

        var total = 5.1 + 3.3;
        console.log(total.toFixed(2));


        //02
        //no implicit conversion
        /*
        var id = "PRD" + "X99";
        console.log(id);

        var id = "PRD" + 2000;
        console.log(id);

        var id = 2000 + "PRD";
        console.log(id);

        var id = "2000" + "500";
        console.log(id);

        var id = 2000 + "500";
        console.log(id);

        var id = 2000 + undefined;
        console.log(id);

        var id = "PRD" + undefined;
        console.log(id);

        var id = 2000 + null;
        console.log(id);

        var id = "PRD" + null;
        console.log(id);

        var id = 2000 + NaN;
        console.log(id);

        var id = "PRD" + NaN;
        console.log(id);
       */
    </script>
</body>
</html>